<?php
//添加关键词排名任务
header('Content-Type:text/html;charset=utf8');
include_once './db.php';
include_once './function.php';

if (!$_GET['cpid'] || !$_GET['type']) {
    echo json_encode(array('code' => 0, 'msg' => '缺少参数', 'data' => '',));
    exit();
}

$db = DB::getIntance();
$db_table = 'work';

$id = $db->insert($db_table, array(
    'cpid' => $_GET['cpid'],
    'type' => $_GET['type'],
    'status' => 0,
));

if ($id > 0) {
    echo json_encode(array('code' => 1, 'msg' => '添加成功', 'data' => '',));
} else {
    echo json_encode(array('code' => 0, 'msg' => '添加失败', 'data' => '',));
}